<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<head>
    <meta charset="utf-8" />
    <title>祈贝健康--后台管理系统</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />

    <!-- ================== BEGIN BASE CSS STYLE ================== -->
    <link href="./Public/Admin/assets/plugins/jquery-ui/themes/base/minified/jquery-ui.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/animate.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/style.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/style-responsive.min.css" rel="stylesheet" />
    <link href="./Public/Admin/assets/css/theme/default.css" rel="stylesheet" id="theme" />
    <!-- ================== END BASE CSS STYLE ================== -->

    <!-- ================== BEGIN PAGE LEVEL STYLE ================== -->
    <link href="./Public/Admin/assets/plugins/DataTables/css/data-table.css" rel="stylesheet" />
    <!-- ================== END PAGE LEVEL STYLE ================== -->

    <!-- ================== BEGIN BASE JS ================== -->
    <script src="./Public/Admin/assets/plugins/pace/pace.min.js"></script>
    <!-- ================== END BASE JS ================== -->
    <style>
        .img-responsive {
            display: block;
            height: auto;
            max-width: 40%;
        }
    </style>
</head>
<body>
<php>include './Public/Admin/header.html'; </php>



<!-- begin #content -->
<div id="content" class="content">
    <!-- begin breadcrumb -->
    <ol class="breadcrumb pull-right">
        <li><a href="javascript:;">首页</a></li>
        <li><a href="javascript:;">管理</a></li>
        <li class="active">管理列表</li>

    </ol>
    <!--添加-->
    <div class="col-sm-4 col-xs-2 pull-right">
        <a data-toggle="modal"  href="index.php?m=Admin&c=Doctor&a=add"
           class="btn btn-success btn-sm pull-right header-btn"><i
                class="fa fa-circle-arrow-up fa-lg"></i>添加医生</a>
    </div>
    <!-- end breadcrumb -->
    <!-- begin page-header -->
    <h1 class="page-header">医生管理 <small>管理列表</small></h1>
    <!-- end page-header -->

    <!-- begin row -->
    <div class="row">
        <!-- begin col-12 -->
        <div class="col-md-12">
            <!-- begin panel -->
            <div class="panel panel-inverse">
                <div class="panel-heading">
                    <div class="panel-heading-btn">
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-default" data-click="panel-expand"><i class="fa fa-expand"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-success" data-click="panel-reload"><i class="fa fa-repeat"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-warning" data-click="panel-collapse"><i class="fa fa-minus"></i></a>
                        <a href="javascript:;" class="btn btn-xs btn-icon btn-circle btn-danger" data-click="panel-remove"><i class="fa fa-times"></i></a>
                    </div>
                    <h4 class="panel-title">医生信息</h4>
                </div>





                <div class="panel-body">
                    <div class="row">
                        <div class="col-sm-3">
                            <input type="text" id="txtsSearch" class="form-control" placeholder="请输入关键字" size="8" maxlength="50"/>
                        </div>
                        <div class="col-sm-3">
                            <a href="javascript:;" class="btn btn-primary btn-md" onclick="return doSomeAction()">执行</a>
                        </div>
                    </div>



                    <div class="modal fade auth_img_modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
                        <div class="modal-dialog modal-lg">
                            <div class="modal-content">

                            </div>
                        </div>
                    </div>





                    <div class="table-responsive">

                        <table id="data-table" class="table table-striped table-bordered">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>登录名</th>
                                <th>真实姓名</th>
                                <th>性别</th>
                                <th>所属医院</th>
                                <th>中文职称</th>
                                <th>英文职称</th>
                                <th>专长中文</th>
                                <th>专长英文</th>
                                <th>中文简介</th>
                                <th>英文简介</th>
                                <th>认证状态</th>
                                <th>证件编号</th>
                                <th>证件照片</th>

                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody id="tbodylist">
                            <!-- <tr>
                                    <td>1</td>
                                    <td>IE</td>
                                    <td>13352646464</td>
                                    <td>hr@qw.com</td>
                                    <td>15</td>
                                    <td>
                                        <a href="#" class="btn btn-large btn-primary btn-xs">编辑</a>
                                        <a href="#" class="btn btn-large btn-primary btn-xs">删除</a>
                                    </td>
                                </tr>-->


                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <!-- end panel -->
        </div>
        <!-- end col-12 -->
    </div>
    <!-- end row -->
</div>
<!-- end #content -->


<!-- begin scroll to top btn -->
<a href="javascript:;" class="btn btn-icon btn-circle btn-success btn-scroll-to-top fade" data-click="scroll-top"><i class="fa fa-angle-up"></i></a>
<!-- end scroll to top btn -->
</div>
<!-- end page container -->

<!-- ================== BEGIN BASE JS ================== -->
<script src="./Public/Admin/assets/plugins/jquery/jquery-1.9.1.min.js"></script>
<script src="./Public/Admin/assets/plugins/jquery/jquery-migrate-1.1.0.min.js"></script>
<script src="./Public/Admin/assets/plugins/jquery-ui/ui/minified/jquery-ui.min.js"></script>
<script src="./Public/Admin/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<!--[if lt IE 9]>
<script src="./Public/Admin/assets/crossbrowserjs/html5shiv.js"></script>
<script src="./Public/Admin/assets/crossbrowserjs/respond.min.js"></script>
<script src="./Public/Admin/assets/crossbrowserjs/excanvas.min.js"></script>
<![endif]-->
<script src="./Public/Admin/assets/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<!-- ================== END BASE JS ================== -->

<!-- ================== BEGIN PAGE LEVEL JS ================== -->
<script src="./Public/Admin/assets/plugins/DataTables/js/jquery.dataTables.js"></script>
<script src="./Public/Admin/assets/plugins/DataTables/js/dataTables.colVis.js"></script>
<script src="./Public/Admin/assets/js/apps.min.js"></script>
<!-- ================== END PAGE LEVEL JS ================== -->

<script>
    $(document).ready(function() {
        App.init();
        $('#data-table').DataTable({
            //  "ajax": 'index.php?m=Admin&c=Doctor&a=get_test',//ajax请求
            "dom": 'tiprl',//自定义显示项
            "columnDefs": [
                {
                    "targets": 0,
                    "data": "id",
                    "width":"6%",
                },
                {
                    "targets": 1,
                    "data": "logname",
                    "width":"4%",
                },
                {
                    "targets": 2,
                    "data": "name" },
                {
                    "targets": 3,
                    "data": "sex" },
                {
                    "targets": 4,
                    "data": "hospital_id" },
                {
                    "targets": 5,
                    "data": "title_cn" },
                {
                    "targets": 6,
                    "data": "title_en" },
                {
                    "targets": 7,

                    "data": "speciality_cn" },
                {
                    "targets": 8,
                    "data": "speciality_en" },
                {

                    "targets": 9,
                    "sWidth":"8%",
                    "data": "abstract",
                    "render": function ( data, type, row,   meta ) { // 返回自定义内容
                        if(row.abstract!=null&&row.abstract.length>114){
                            row.abstract=row.abstract.substring(0,114);
                            row.abstract+='…';
                        }
                        return row.abstract;
                    }
                },
                {
                    "targets": 10,
                    "sWidth":"8%",
                    "data": "descrip",
                    "render": function ( data, type, row,   meta ) { // 返回自定义内容
                        if(row.descrip!=null&&row.descrip.length>114){
                            row.descrip=row.descrip.substring(0,114);
                            row.descrip+='…';
                        }
                        return row.descrip;
                    }


                },
                {
                    "targets": 11,
                    "data": "auth_status",
                    "render": function ( data, type, row,   meta ) { // 返回自定义内容
                        if(row.auth_status==0){
                            row.auth_status='已注册';
                        }else if(row.auth_status==1){
                            row.auth_status='正在认证';
                        }else if(row.auth_status==2){
                            row.auth_status='认证成功';
                        }else if(row.auth_status==3){
                            row.auth_status='认证失败';
                        }
                        return  row.auth_status;
                    }

                },
                {
                    "targets": 12,
                    "data": "document_number" },


                {
                    "targets": 13,
                    "sWidth": "15%",
                    "data": "auth_img",
                    "render": function ( data, type, row,   meta ) { // 返回自定义内容

                        return '<img  id="num'+row.id+'"  onclick="test('+row.id +')"  src="/imagecn_doc/'+row.auth_img +'" class="img-responsive"   alt="暂无图片">';

                    }
                },

                // 增加一列，包括删除和修改，同时将需要传递的数据传递到链接中
                {
                    "targets": 14, // 目标列位置，下标从0开始
                    "render": function ( data, type, row,   meta ) { // 返回自定义内容

                        return  '<td><a href="index.php?m=Admin&c=Doctor&a=update&id='+row.id+'" class="btn btn-large btn-primary btn-xs">编辑</a>' +
                                '&nbsp;<a href="#" onclick="del('+row.id+')" class="btn btn-large btn-primary btn-xs">删除</a>' +
                                '&nbsp;<a href="#" onclick="auth('+row.id+')"  class="btn btn-large btn-primary btn-xs">认证</a>' +
                                '</td>';
                    }
                }
            ],
            "oLanguage": {
                "sProcessing": "努力加载数据中.",
                "sLengthMenu": "每页显示 _MENU_ 条记录",
                "sZeroRecords": "抱歉， 没有找到",
                "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
                "sInfoEmpty": "没有数据",
                "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
                "sSearch": "搜索:  ",
                "oPaginate": {
                    "sFirst": "首页",
                    "sPrevious": "上一页",
                    "sNext": "下一页",
                    "sLast": "尾页"
                }
            },
            "sPaginationType": "full_numbers",
            "bProcessing": true,
            "bServerSide": true,
            "bSort":false,
            "bFilter": true,
            "sAjaxSource": "index.php?m=Admin&c=Doctor&a=get_lists",

            "fnServerParams": function( aoData )
            {
                aoData.push(
                        {"name":"keywords","value":$('#keyword_txt').val()},
                        {"name":"start_date","value":$('#start_date_txt').val()},
                        {"name":"end_date","value":$('#end_date_txt').val()}
                )
            },
            "deferRender": true,//处理大数据时延迟渲染数据
        });



    });


    function del(obj){
        if(confirm("你确定要删除？")){
            $.getJSON("index.php?m=Admin&c=Doctor&a=del&id="+obj,function(result){
                if(result==1){
                    location.href="index.php?m=Admin&c=Doctor&a=lists";
                }
            });
        }

    }

    function auth(obj){
        if(confirm("认证通过？")){
            $.getJSON("index.php?m=Admin&c=Doctor&a=auth&type=1&id="+obj,function(result){
                if(result==1){
                    location.href="index.php?m=Admin&c=Doctor&a=lists";
                }
            });
        }else{
            $.getJSON("index.php?m=Admin&c=Doctor&a=auth&type=2&id="+obj,function(result){
                if(result==1){
                    location.href="index.php?m=Admin&c=Doctor&a=lists";
                }
            });
        }
    }
</script>
<script>
    function test(obj){
        var sc= $("#num"+obj).attr("src");//获得图片地址
        var displayImg='<img  src="'+ sc+'" alt="暂无图片">';//拼接路径
        $(".modal-content").html(displayImg);//把路径追加到模态页面
        $('.auth_img_modal').modal('toggle');//调用模态的某个方法，手动打开或隐藏一个模态对话框。
    }

</script>


</body>
</html>

